﻿(function(E, T, $){
var selection = E.mod('Selection'),
	testName = 'Code',
	title = '插入代码',
	setValue = '<span id="_testCode"></span>',
	dom = null,
	node = null,
	innerCode = '(function(E, T, $){\n\
		T.addTest(testName,cmds);\n\
	var selection = E.mod("Selection"),\n\
		testName = "Code",\n\
	})(jQEditor,AutoTest, jQuery)',
	cmds = [
		[1500, {fun: function() {
			dom = E.get('document');
			dom.body.innerHTML=setValue;
			node = dom.getElementById('_testCode');
			selection.selectNode(node, false);
		}}],
		[500, {name: '#demo-Code', type: 'mouseover'}],
		[500, {name: '#demo-Code a.Code', type: 'click'}],
		[500, {name: '#panel_Code input[name=panel-submit]', type: 'click'}],
		[500, {fun : function() {
			$('#panel_Code [name=code_language]').val('js');
		}}],
		[500, {fun : function() {
			$('#panel_Code textarea').val(innerCode);
		}}],
		[500, {name: '#panel_Code input[name=panel-submit]', type: 'click'}]
	];

T.addTest(testName, cmds, title);
})(jQEditor,AutoTest, jQuery)